home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / System / BoingBag1 / Contributions / InstallerNG / GUI-API / example / igui_QuietWaitApp.c < prev    next >
C/C++ Source or Header  |  1999-10-31  |  2KB  |  76 lines

  1.  
  2. #include "includes.h"
  3. #include "installergui_data.h"
  4.  
  5. /********************************************************************
  6.  *
  7.  *  DESCRIPTION
  8.  *
  9.  */
  10.  
  11. /********************************************************************
  12.  *
  13.  *  STATIC
  14.  *
  15.  */
  16.  
  17. /********************************************************************
  18.  *
  19.  *  EXTERN
  20.  *
  21.  */
  22.  
  23. /********************************************************************
  24.  *
  25.  *  PUBLIC
  26.  *
  27.  */
  28.  
  29. /********************************************************************
  30.  *
  31.  *  CODE
  32.  *
  33.  */
  34.  
  35. long __asm igui_QuietWaitApp(register __a0 APTR application)
  36. {
  37.   #ifdef DEBUG
  38.   DEBUG_MAKRO
  39.   #endif
  40.  
  41.   {
  42.     long sigs = 0, event;
  43.     struct Application *app = (struct Application *) application;
  44.  
  45.     // first wake up the application
  46.     guistuff_WakeApp(app);
  47.  
  48.     // wait for user input
  49.     while (TRUE)
  50.     {
  51.       DoMethod(app->app_Application, MUIM_Application_NewInput, &sigs);
  52.       if (sigs)
  53.       {
  54.         sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D | SIGBREAKF_CTRL_E);
  55.  
  56.         if (sigs & SIGBREAKF_CTRL_D) { event = GUIEVENT_PROCEED; break; } // proceed button
  57.         if (sigs & SIGBREAKF_CTRL_C) { event = GUIEVENT_QUIT; break; }  // quit
  58.         if (sigs & SIGBREAKF_CTRL_E)  // cancel button        
  59.         {
  60.           // take care for the BACK button!
  61.           if (app->app_BACK_Mode) { event = GUIEVENT_BACK; }
  62.           else                    { event = GUIEVENT_ABORT; }
  63.           
  64.           break; 
  65.         }  
  66.       }
  67.     }
  68.  
  69.     // lay down to sleep
  70.     guistuff_SleepApp(app);
  71.  
  72.     // give back the event
  73.     app->app_CurrentGUIEvent = event;
  74.     return(event);
  75.   }
  76. }